namespace QMVnSoft.ReportForms
{
    using QMVnSoft.Controls;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormReportEditor : FormControl
    {
        private BtnControl btnCancel;
        private BtnControl btnOk;
        private ChkControl chkOnTop;
        private IContainer components;
        private bool ib_CheckAccepted;
        private LabelControl lblBar;
        private LabelControl lblBar_E;
        private LabelControl lblFormFile;
        private LabelControl lblGroup;
        private LabelControl lblIndex;
        private LabelControl lblRepoFile;
        private LabelControl lblSeries;
        private LabelControl lblTitle;
        private LabelControl lblTitle_E;
        private TextControl txtBar;
        private TextControl txtBar_E;
        private TextControl txtFormFile;
        private TextControl txtGroup;
        private TextNumeric txtIndex;
        private TextControl txtRepoFile;
        private TextControl txtSeries;
        private TextControl txtTitle;
        private TextControl txtTitle_E;

        public FormReportEditor()
        {
            this.InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.CheckAccepted = true;
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            //ComponentResourceManager manager = new ComponentResourceManager(typeof(FormReportEditor));
            this.lblBar = new LabelControl();
            this.txtBar = new TextControl();
            this.lblBar_E = new LabelControl();
            this.txtBar_E = new TextControl();
            this.lblTitle = new LabelControl();
            this.txtTitle = new TextControl();
            this.lblTitle_E = new LabelControl();
            this.txtTitle_E = new TextControl();
            this.lblFormFile = new LabelControl();
            this.txtFormFile = new TextControl();
            this.lblRepoFile = new LabelControl();
            this.txtRepoFile = new TextControl();
            this.btnCancel = new BtnControl();
            this.btnOk = new BtnControl();
            this.lblGroup = new LabelControl();
            this.txtGroup = new TextControl();
            this.txtIndex = new TextNumeric();
            this.lblIndex = new LabelControl();
            this.lblSeries = new LabelControl();
            this.txtSeries = new TextControl();
            this.chkOnTop = new ChkControl();
            base.SuspendLayout();
            this.lblBar.AutoSize = true;
            this.lblBar.Font = new Font("Arial", 8.25f);
            this.lblBar.Location = new Point(12, 0x1f);
            this.lblBar.Name = "lblBar";
            this.lblBar.Size = new Size(0x18, 14);
            this.lblBar.TabIndex = 0;
            this.lblBar.Text = "Bar";
            this.txtBar.CheckTextSearched = false;
            this.txtBar.DisabledForeColor = Color.Blue;
            this.txtBar.Font = new Font("Arial", 8.25f);
            this.txtBar.Location = new Point(0x55, 0x1c);
            this.txtBar.Name = "txtBar";
            this.txtBar.OldValue = null;
            this.txtBar.Size = new Size(0x173, 20);
            this.txtBar.TabIndex = 2;
//            this.txtBar.Value = null;//manager.GetObject("txtBar.Value");
            this.lblBar_E.AutoSize = true;
            this.lblBar_E.Font = new Font("Arial", 8.25f);
            this.lblBar_E.Location = new Point(12, 0x35);
            this.lblBar_E.Name = "lblBar_E";
            this.lblBar_E.Size = new Size(60, 14);
            this.lblBar_E.TabIndex = 0;
            this.lblBar_E.Text = "English bar";
            this.txtBar_E.CheckTextSearched = false;
            this.txtBar_E.DisabledForeColor = Color.Blue;
            this.txtBar_E.Font = new Font("Arial", 8.25f);
            this.txtBar_E.Location = new Point(0x55, 50);
            this.txtBar_E.Name = "txtBar_E";
            this.txtBar_E.OldValue = null;
            this.txtBar_E.Size = new Size(0x173, 20);
            this.txtBar_E.TabIndex = 3;
//            this.txtBar_E.Value = null;//manager.GetObject("txtBar_E.Value");
            this.lblTitle.AutoSize = true;
            this.lblTitle.Font = new Font("Arial", 8.25f);
            this.lblTitle.Location = new Point(12, 0x4b);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x1a, 14);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "Title";
            this.txtTitle.CheckTextSearched = false;
            this.txtTitle.DisabledForeColor = Color.Blue;
            this.txtTitle.Font = new Font("Arial", 8.25f);
            this.txtTitle.Location = new Point(0x55, 0x48);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.OldValue = null;
            this.txtTitle.Size = new Size(0x173, 20);
            this.txtTitle.TabIndex = 4;
//            this.txtTitle.Value = null;//manager.GetObject("txtTitle.Value");
            this.lblTitle_E.AutoSize = true;
            this.lblTitle_E.Font = new Font("Arial", 8.25f);
            this.lblTitle_E.Location = new Point(12, 0x61);
            this.lblTitle_E.Name = "lblTitle_E";
            this.lblTitle_E.Size = new Size(60, 14);
            this.lblTitle_E.TabIndex = 0;
            this.lblTitle_E.Text = "English title";
            this.txtTitle_E.CheckTextSearched = false;
            this.txtTitle_E.DisabledForeColor = Color.Blue;
            this.txtTitle_E.Font = new Font("Arial", 8.25f);
            this.txtTitle_E.Location = new Point(0x55, 0x5e);
            this.txtTitle_E.Name = "txtTitle_E";
            this.txtTitle_E.OldValue = null;
            this.txtTitle_E.Size = new Size(0x173, 20);
            this.txtTitle_E.TabIndex = 5;
//            this.txtTitle_E.Value = null;//manager.GetObject("txtTitle_E.Value");
            this.lblFormFile.AutoSize = true;
            this.lblFormFile.Font = new Font("Arial", 8.25f);
            this.lblFormFile.Location = new Point(12, 0x77);
            this.lblFormFile.Name = "lblFormFile";
            this.lblFormFile.Size = new Size(0x1f, 14);
            this.lblFormFile.TabIndex = 0;
            this.lblFormFile.Text = "Form";
            this.txtFormFile.CharacterCasing = CharacterCasing.Upper;
            this.txtFormFile.CheckTextSearched = false;
            this.txtFormFile.DisabledForeColor = Color.Blue;
            this.txtFormFile.Font = new Font("Arial", 8.25f);
            this.txtFormFile.Location = new Point(0x55, 0x74);
            this.txtFormFile.Name = "txtFormFile";
            this.txtFormFile.OldValue = null;
            this.txtFormFile.Size = new Size(0x92, 20);
            this.txtFormFile.TabIndex = 6;
//            this.txtFormFile.Value = null;//manager.GetObject("txtFormFile.Value");
            this.lblRepoFile.AutoSize = true;
            this.lblRepoFile.Font = new Font("Arial", 8.25f);
            this.lblRepoFile.Location = new Point(0x109, 0x77);
            this.lblRepoFile.Name = "lblRepoFile";
            this.lblRepoFile.Size = new Size(0x27, 14);
            this.lblRepoFile.TabIndex = 0;
            this.lblRepoFile.Text = "Report";
            this.txtRepoFile.CharacterCasing = CharacterCasing.Upper;
            this.txtRepoFile.CheckTextSearched = false;
            this.txtRepoFile.DisabledForeColor = Color.Blue;
            this.txtRepoFile.Font = new Font("Arial", 8.25f);
            this.txtRepoFile.Location = new Point(310, 0x74);
            this.txtRepoFile.Name = "txtRepoFile";
            this.txtRepoFile.OldValue = null;
            this.txtRepoFile.Size = new Size(0x92, 20);
            this.txtRepoFile.TabIndex = 7;
//            this.txtRepoFile.Value = null;//manager.GetObject("txtRepoFile.Value");
            this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            //this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Font = new Font("Arial", 8.25f);
            this.btnCancel.Location = new Point(0x17d, 0xae);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 11;
            this.btnCancel.Text = "&Cancel";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnOk.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
            this.btnOk.Font = new Font("Arial", 8.25f);
            this.btnOk.Location = new Point(300, 0xae);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new Size(0x4b, 0x17);
            this.btnOk.TabIndex = 10;
            this.btnOk.Text = "&Ok";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnOk.Click += new EventHandler(this.btnOk_Click);
            this.lblGroup.AutoSize = true;
            this.lblGroup.Font = new Font("Arial", 8.25f);
            this.lblGroup.Location = new Point(0x109, 8);
            this.lblGroup.Name = "lblGroup";
            this.lblGroup.Size = new Size(0x25, 14);
            this.lblGroup.TabIndex = 0;
            this.lblGroup.Text = "Group";
            this.txtGroup.CheckTextSearched = false;
            this.txtGroup.DisabledForeColor = Color.Blue;
            this.txtGroup.Font = new Font("Arial", 8.25f);
            this.txtGroup.Location = new Point(310, 5);
            this.txtGroup.Name = "txtGroup";
            this.txtGroup.OldValue = null;
            this.txtGroup.Size = new Size(0x92, 20);
            this.txtGroup.TabIndex = 1;
//            this.txtGroup.Value = null;//manager.GetObject("txtGroup.Value");
            this.txtIndex.Font = new Font("Arial", 8.25f);
            this.txtIndex.Location = new Point(0x55, 5);
            this.txtIndex.Name = "txtIndex";
            this.txtIndex.NumericScaleOnFocus = 0;
            this.txtIndex.NumericScaleOnLostFocus = 0;
            int[] bits = new int[4];
            this.txtIndex.NumericValue = new decimal(bits);
            this.txtIndex.OldValue = null;
            this.txtIndex.Size = new Size(0x92, 20);
            this.txtIndex.TabIndex = 0;
            this.txtIndex.TextAlign = HorizontalAlignment.Right;
//            this.txtIndex.Value = null;//manager.GetObject("txtIndex.Value");
            this.lblIndex.AutoSize = true;
            this.lblIndex.Font = new Font("Arial", 8.25f);
            this.lblIndex.Location = new Point(12, 8);
            this.lblIndex.Name = "lblIndex";
            this.lblIndex.Size = new Size(0x21, 14);
            this.lblIndex.TabIndex = 0;
            this.lblIndex.Text = "Index";
            this.lblSeries.AutoSize = true;
            this.lblSeries.Font = new Font("Arial", 8.25f);
            this.lblSeries.Location = new Point(12, 0x8d);
            this.lblSeries.Name = "lblSeries";
            this.lblSeries.Size = new Size(0x26, 14);
            this.lblSeries.TabIndex = 0;
            this.lblSeries.Text = "Series";
            this.txtSeries.CheckTextSearched = false;
            this.txtSeries.DisabledForeColor = Color.Blue;
            this.txtSeries.Font = new Font("Arial", 8.25f);
            this.txtSeries.Location = new Point(0x55, 0x8a);
            this.txtSeries.Name = "txtSeries";
            this.txtSeries.OldValue = null;
            this.txtSeries.Size = new Size(0x92, 20);
            this.txtSeries.TabIndex = 8;
//            this.txtSeries.Value = null;//manager.GetObject("txtSeries.Value");
            this.chkOnTop.AutoSize = true;
            this.chkOnTop.CheckAlign = ContentAlignment.MiddleRight;
            this.chkOnTop.Font = new Font("Arial", 8.25f);
            this.chkOnTop.Location = new Point(0x167, 140);
            this.chkOnTop.Name = "chkOnTop";
            this.chkOnTop.Size = new Size(0x61, 0x12);
            this.chkOnTop.TabIndex = 9;
            this.chkOnTop.Text = "Always on top";
            this.chkOnTop.UseVisualStyleBackColor = true;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.CancelButton = this.btnCancel;
            base.ClientSize = new Size(0x1d4, 0xd1);
            base.Controls.Add(this.chkOnTop);
            base.Controls.Add(this.txtIndex);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnOk);
            base.Controls.Add(this.txtGroup);
            base.Controls.Add(this.txtRepoFile);
            base.Controls.Add(this.lblGroup);
            base.Controls.Add(this.txtSeries);
            base.Controls.Add(this.txtFormFile);
            base.Controls.Add(this.lblRepoFile);
            base.Controls.Add(this.lblSeries);
            base.Controls.Add(this.txtTitle_E);
            base.Controls.Add(this.lblFormFile);
            base.Controls.Add(this.txtTitle);
            base.Controls.Add(this.lblTitle_E);
            base.Controls.Add(this.txtBar_E);
            base.Controls.Add(this.lblTitle);
            base.Controls.Add(this.txtBar);
            base.Controls.Add(this.lblBar_E);
            base.Controls.Add(this.lblIndex);
            base.Controls.Add(this.lblBar);
            //base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FormReportEditor";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == (Keys.Control | Keys.Return))
            {
                this.CheckAccepted = true;
                base.Close();
                return true;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }

        public bool AlwaysOnTop
        {
            get
            {
                return this.chkOnTop.Checked;
            }
            set
            {
                this.chkOnTop.Checked = value;
            }
        }

        public bool CheckAccepted
        {
            get
            {
                return this.ib_CheckAccepted;
            }
            set
            {
                this.ib_CheckAccepted = value;
            }
        }

        public object FormFile
        {
            get
            {
                return this.txtFormFile.Value;
            }
            set
            {
                this.txtFormFile.Value = value;
            }
        }

        public int IndexNumber
        {
            get
            {
                return (int) this.txtIndex.NumericValue;
            }
            set
            {
                this.txtIndex.Value = value;
            }
        }

        public object RepoFile
        {
            get
            {
                return this.txtRepoFile.Value;
            }
            set
            {
                this.txtRepoFile.Value = value;
            }
        }

        public object ReportBar
        {
            get
            {
                return this.txtBar.Value;
            }
            set
            {
                this.txtBar.Value = value;
            }
        }

        public object ReportBarE
        {
            get
            {
                return this.txtBar_E.Value;
            }
            set
            {
                this.txtBar_E.Value = value;
            }
        }

        public object ReportGroups
        {
            get
            {
                return this.txtGroup.Value;
            }
            set
            {
                this.txtGroup.Value = value;
            }
        }

        public object ReportTitle
        {
            get
            {
                return this.txtTitle.Value;
            }
            set
            {
                this.txtTitle.Value = value;
            }
        }

        public object ReportTitleE
        {
            get
            {
                return this.txtTitle_E.Value;
            }
            set
            {
                this.txtTitle_E.Value = value;
            }
        }

        public object Series
        {
            get
            {
                return this.txtSeries.Value;
            }
            set
            {
                this.txtSeries.Value = value;
            }
        }

        public bool SetTitle
        {
            set
            {
                if (value)
                {
                    this.Text = "Add more report";
                }
                else
                {
                    this.Text = "Edit current report";
                }
            }
        }
    }
}

